function [ fp_rate_SignalSamples, fp_time_axis ] = SignalExpander( Signal,MWCStruct, SignalSampleSequences, Sample_t_axis )
%MWC_DIGITALPROCESS Summary of this function goes here
%   Detailed explanation goes here


%Extract Signal Parametrs
q = MWCStruct.q;
m = MWCStruct.m;
fp = MWCStruct.fp;
%%   Expand sequences, if needed

if (q>1)

    % digital expansion filter (also polyphase)
%     h_expand = fir1(100,1/q);       %filter order of 100 was found through simulation to be optimal
    h_expand = fir1(500,1/q); %ETGAR - Testing
    lenh_ex = length(h_expand);
    polylen_ex = ceil(lenh_ex / q);
    h_expand_pad = [h_expand zeros(1,polylen_ex*q - lenh_ex) ];
    polyh_expand = reshape(h_expand_pad,q,polylen_ex);

    qtag = floor(q/2);
     SampleLength = length(Sample_t_axis);
    fp_rate_SignalSamples = [];

    for channel = 1:m

            SignalSequence = SignalSampleSequences(channel, 1:SampleLength);

            for factor = 1:q
                %shift signal by k*fp to base band (k= -q',...,0,...,q')
                ShiftFactor  = (factor-1-qtag)*fp;
                TimeModSeq = exp(-1j*2*pi* ShiftFactor *Sample_t_axis);
                SignalMod = SignalSequence .* TimeModSeq;

                [SamplesFp, fp_time_axis] = PolyFilterDecimate(SignalMod,Sample_t_axis,polyh_expand,lenh_ex);
                location = (channel-1)*q+factor;
                DigitalLength = min(length(fp_time_axis),length(SamplesFp));
                fp_rate_SignalSamples(location,1 :DigitalLength) = SamplesFp(1 :DigitalLength);
                fp_time_axis = fp_time_axis(1:DigitalLength);

            end
    end
else  %% 999 examine how it works when q==1
    fp_time_axis = Sample_t_axis;
    fp_rate_SignalSamples = SignalSampleSequences;
end



end



